<template>
  <div class="">
    <h1>组件1</h1>
    <button @click="postmsg">传数据</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      msg: "兄弟组件1里的msg",
    };
  },
  mounted() {},
  methods: {
    postmsg() {
      this.$bus.$emit("aa", this.msg);
    },
    //向组件2发送数据
  },
  components: {},
};
</script>

<style lang="scss"></style>
